import {
	request
} from '@/amtf/utils/request'

export const 查轮播图 = (params) => {
	return request({
		url: '/lysd/lunbo',
		method: 'get',
		params
	})
}

export const 查商品 = (params) => {
	return request({
		url: '/lysd/shangpin',
		method: 'get',
		params
	})
}

export const 查sku = (params) => {
	return request({
		url: '/lysd/shangpinsku',
		method: 'get',
		params
	})
}

// 获取省市县区
export const getGeos = (params) => {
  return request({
    url: `/geo/getGeos?level=${params.level}&code=${params.code}`,
    method: 'get'
  })
}

export const getCaptcha  = () => {
    return request({
		url:'/base/captcha',
        method: 'post'
    })
}

export const register  = (data) => {
    return request({
		url:'/user/register',
        method: 'post',
        data:data
    })
}

export const login  = (data) => {
    return request({
		url:'/base/login',
        method: 'post',
        data:data
    })
}

export const getUserInfo  = () => {
    return request({
		url:'/user/getUserInfo',
        method: 'get'
    })
}

export const getOpenID  = (params) => {
    return request({
		url: `/clientUser/getOpenID?code=${params}`,
        method: 'get'
    })
}

// 获取唤醒微信支付的参数
export const getPayParams  = (data) => {
    return request({
		url:'/wxpay/getPayParams',
        method: 'post',
        data:data
    })
}

// 获取支付结果
export const getOrderById  = (params) => {
    return request({
		url:`/wxpay/getOrderById?orderID=${params}`,
        method: 'get'
    })
}

// 修改用户信息
export const setClientUserInfo  = (data) => {
    return request({
		url:`/clientUser/setClientUserInfo`,
        method: 'post',
		data,
    })
}